import service from "@/utils/request";
export const getPCPlateContent=()=>{
  return service({
    url:"/api/app/shundian/plateContent/getPcPlateContent",
  });
}
export const getPcGoodsCat=()=>{
  return service({
    url:"/api/app/shundian/plateContent/getPcGoodsCat",
    method: "post" 
  });
}
export const getGoodsDetail = (params) => {
  const goodsId = String(params?.goodsId || params?.id || '').trim();
  const formData = new URLSearchParams();
  formData.append('goodsId', goodsId);
  formData.append('type', params.type || 0);
  formData.append('cityId', params.cityId || 524);

  return service({
    url: "/api/app/happinesswebsite/goods/goodsDetail",
    method: "post",
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'X-Mall-Code': 'SD001',
      'X-Platform': 'pc',
      'X-Token': (localStorage.getItem('token') || '').trim()
    },
    data: formData.toString(),
    timeout: 10000
  });
}
